home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)abl.d64
/
HANGMAN
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
146 lines
1 POKE691,1:GOTO52
2 SYS52440:A$=LEFT$(SP$,A1%):SYS52360:RETURN
3 SYS52300:IFA1%<0THEN5
4 A$=LEFT$(SP$,A1%):SYS52360:GOSUB38:O$=A$:RETURN
5 GOTO33
6 SYS52340:RETURN
7 PRINT"[152]";:GOSUB8:SYS52310:RETURN
8 IFLL=1OR(PEEK(56577)AND16)=THTHENRETURN
9 GOTO31
10 POKE659,6+ABS((BD=1200)*2):C=1022730/BD:GOSUB23:POKE51968,A2%:POKE51969,A1%
11 IFBD=1200THENC=1022730/BD*.966:GOSUB23
12 POKE665,A2%:POKE666,A1%:C=1022730/BD/2-100:GOSUB23:POKE661,A2%:POKE662,A1%
13 RETURN
14 B$="[164]"
15 SYS52450:B$=LEFT$(A$,ABS(A1%-1)):RETURN
16 A$="":SYS52320:IFA2%=0THENRETURN
17 IFA2%=1ORA2%=3ORA2%=16ORA2%=9THENA$="[193]":RETURN
18 IFA2%<>83ANDA2%<>19THENRETURN
19 FORKK=1TO2E3:SYS52320:IFA2%=0THEN22
20 IFA2%=17ORA2%=67THENKK=2E3
21 IFA2%=65ORA2%=13THENA$="[193]":KK=2E3
22 NEXTKK:RETURN
23 A1%=C/256:A2%=C-A1%*256:RETURN
24 GOSUB7:IFIT$=""THENGOSUB3:IT$=A$:GOSUB27:RETURN
25 GOSUB27:IFPEEK(679)<>1THENGOSUB7:O$=A$:A$="":GOSUB7:A$=O$
26 RETURN
27 A$=IT$:B$=":":GOSUB15:IFA1%=0THENIT$="":RETURN
28 IT$=MID$(A$,A1%+1):A$=B$:RETURN
29 A$=LEFT$(RK$,30):GOSUB14:N$=B$:SC=ASC(MID$(RK$,37,1)):CW=ASC(MID$(RK$,41,1))
30 TD$=MID$(RK$,48,2):TU$=MID$(RK$,50,2):A$=" ":SYS52330:A$=A$+" "
31 SYS52330:DW$=A$:RETURN
32 A$="[211]TANDBY - [210]ETURNING TO [194][194][211]...":GOSUB7
33 A$=TD$:B$=TU$:RK$=LEFT$(RK$,47)+A$+B$+MID$(RK$,52):PRINT
34 PRINT:PRINT"[145][145][145][145]SYS52470:REM[145][145][145]"
35 SYS52410:A$=RK$:A1%=-1:SYS52420:A$=STR$(BD)+" "+STR$(LL):A1%=-1:SYS52420
36 A$=STR$(TH):A1%=-1:SYS52420:A$=IT$:A1%=-1:SYS52420:A$=""
37 POKE631,13:POKE198,1:CLOSE5:END
38 IFA2%<1THENRETURN
39 B$=A$:IFA2%<>67THENIT$="[194][194][211]:[199]:[217]:[193][213][212][207] [212][197][210][205][201][206][193][212][201][207][206]":RETURN
40 CT=VAL(MID$(TI$,3,2))+VAL(LEFT$(TI$,2))*60:TA=SC*10+10:RETURN
41 GOSUB16:IFA$="[193]"THENRETURN:REM READ FILE ROUTINE
42 A$="":GOSUB7
43 POKE684,0:OPEN4,8,4,"0:"+F$+",S,R":GET#4,C$
44 FF%=0:IFST<>0THENFF%=1:CLOSE4:OPEN4,8,4,"$":GOTO47
45 A$=LEFT$(SP$,CW):SYS52380:A$=C$+LEFT$(A$,A1%):C$="":IFA2%<1THENC$=""
46 A3%=A2%:GOSUB7:GOSUB16:IFA$<>"[193]"ANDA3%<1THEN45
47 POKE684,0:AB%=-(A$="[193]"):CLOSE4:A$="":GOSUB7:RETURN
48 OPEN1,8,15:OPEN2,8,2,"0:/HANGLIST,S,R":INPUT#2,NW:INPUT#1,EN:FF%=0
49 IFNW=0THENFF%=1
50 RETURN
51 CLOSE2:CLOSE1:RETURN
52 OPEN5,2,0:A1%=1:A2%=1:FORK=1TO127:SP$=SP$+" ":NEXTK:A$="":ZE$=CHR$(0)
53 A1%=0:GOSUB2:RK$=A$:POKE680,70:A1%=1:GOSUB2:BD=VAL(LEFT$(A$,5))
54 LL=VAL(MID$(A$,6)):A1%=2:GOSUB2:TH=VAL(A$):A1%=3:GOSUB2:IT$=A$:GOSUB10:GOSUB29
55 A$=" [200][193][206][199][205][193][206] ([214]1.0)":GOSUB7
56 A$=" ([195])1990 [205]IKE [203]ERR":GOSUB7:GOSUB128
57 POKE680,70:GOSUB40:IFCT>TATHEN32
58 A$="[200]ANGMAN > ":GOSUB24:GOSUB6:IFA$="[194][194][211]"THEN32
59 IFA$="[199]"THENIT$=A$:GOTO32
60 IFA$="?"ORA$="[200][197][204][208]"THENGOSUB139:GOTO57
61 IFA$="[208][204][193][217]"THENNT=0:CC=0:GOTO80
62 IFA$="[200][201][199][200]"THEN118
63 A$="[197]NTER ? [198]OR [200]ELP.":GOSUB7:GOTO57
64 A$="[211]EARCHING [200][201][199][200] [211][195][207][210][197][211]...":GOSUB7
65 OPEN1,8,15:OPEN2,8,2,"0:/HANGHIGH,S,R":INPUT#1,EN:IFEN=62THEN68
66 FORK=1TO9:INPUT#2,P$(K):INPUT#2,S(K):NEXTK:CLOSE2:CLOSE1
67 GOTO71
68 CLOSE2:OPEN2,8,2,"@:/HANGHIGH,S,W":S=0:NA$="[200]IGH [211]CORES [204]IST"
69 FORK=1TO9:PRINT#2,NA$:PRINT#2,S:NEXTK:CLOSE2:OPEN2,8,2,"0:/HANGHIGH,S,R"
70 GOTO66
71 K=0:HS=0
72 K=K+1:ON-(K>9)GOTO75:IFP$(K)=N$THEN78
73 IFTT>=S(K)ORS(K)=0THENHS=1:GOTO79
74 GOTO72
75 IFHS<>1THENA$="[211]ORRY, YOU DIDN'T MAKE THE [200][201][199][200] [211][195][207][210][197][211]!":GOSUB7:GOTO57
76 OPEN2,8,2,"@:/HANGHIGH,S,W":FORK=1TO9:PRINT#2,P$(K):PRINT#2,S(K):NEXTK
77 CLOSE2:A$="[200][201][199][200] [211][195][207][210][197][211] UPDATED!":GOSUB7:GOTO57
78 A$="[217]OU'RE ALREADY IN THE [200][201][199][200] [211][195][207][210][197][211]!":GOSUB7:GOTO57
79 FORC=10TOK+1STEP-1:S(C)=S(C-1):P$(C)=P$(C-1):NEXTC:S(K)=TT:P$(K)=N$:GOTO75
80 GOSUB48:IFFF%THENA$="[206]O WORDS AVAILABLE.":GOSUB7:GOSUB51:GOTO57
81 A$="[147][204]EAFING THROUGH DICTIONARY.. ":GOSUB7:NT=NT+1
82 WN=INT(RND(TI)*NW)+1:FORK=1TOWN:INPUT#2,WD$:INPUT#2,CL$:NEXTK:A$="[199]OT [207]NE!":GOSUB7
83 AB$="[193][194][195][196][197][198][199][200][201][202][203][204][205][206][207][208][209][210][211][212][213][214][215][216][217][218]":BD$(1)="[200][197][193][196]":BD$(2)="[212][207][210][211][207]":BD$(3)="[204]-[193][210][205]"
84 BD$(4)="[210]-[193][210][205]":BD$(5)="[204]-[204][197][199]":BD$(6)="[210]-[204][197][199]":HM=7:UW$="":POKE680,1:GOSUB51
85 FORK=1TOLEN(WD$):UW$=UW$+".":NEXTK:A$=WD$:GOSUB6:WD$=A$
86 BO$="":FORK=1TO6:BO$=BO$+BD$(K)+" ":NEXTK
87 A$="[200]ANGMAN: "+BO$:GOSUB7:IFHM=1THEN107
88 A$="[204]ETTERS: "+AB$+"":GOSUB7
89 A$="[195]LUE: "+CL$+".[215]ORD: "+UW$+"":GOSUB7:IFUW$=WD$THEN106
90 GOSUB40:IFCT>TATHEN32
91 A$=" [1]: [199]UESS [2]: [209]UIT[208]ICK A LETTER: ":GOSUB24:GOSUB6:LE$=A$
92 IFLE$="2"ORLE$="[209][213][201][212]"THEN108
93 IFLE$="1"ORLE$="[199][213][197][211][211]"THEN111
94 IFLEN(LE$)<>1THEN90
95 IFLE$<"[193]"ORLE$>"[218]"THENA$="[201]NVALID ENTRY.":GOSUB7:GOTO86
96 K=ASC(LE$)-192:IFMID$(AB$,K,1)=" "THEN103
97 AB$=LEFT$(AB$,K-1)+" "+MID$(AB$,K+1):OK=0
98 FORK=1TOLEN(WD$):IFLE$=MID$(WD$,K,1)THENGOSUB101
99 NEXTK:IFOK=0THEN104
100 GOTO102
101 UW$=LEFT$(UW$,K-1)+LE$+MID$(UW$,K+1):OK=1:RETURN
102 A$="[199]OOD GUESS!":GOSUB7:GOTO86
103 A$="[217]OU ALREADY USED THAT LETTER!":GOSUB7:GOTO86
104 A$="[206]O MATCH!":GOSUB7
105 HM=HM-1:BD$(HM)="****":GOTO86
106 A$="[212]HE ANSWER IS OBVIOUS.":GOSUB7:GOTO108
107 A$="[217]OU HAVE BEEN [200][213][206][199]!":GOSUB7:GOTO108
108 A$="[212]RY AGAIN (Y/N)? ":GOSUB24:GOSUB6:IFA$="[217]"ORA$=""THEN80
109 IFA$="[206]"THEN116
110 GOTO108
111 POKE680,LEN(WD$)
112 GOSUB40:IFCT>TATHEN32
113 A$="[217]OUR GUESS: ":GOSUB24:GOSUB6
114 IFA$<>WD$THENA$="[211]ORRY, BUT THAT'S INCORRECT!":GOSUB7:GOTO108
115 A$="[195][207][210][210][197][195][212]! [195]ONGRATULATIONS!":GOSUB7:CC=CC+1:GOTO108
116 TT=INT((CC/NT)*100):IFTT=0THENA$="[217]OU DIDN'T GET ANY CORRECT!":GOSUB7:GOTO57
117 GOTO64
118 A$=" [200]ANGMAN [200]IGH [211]CORES:"
119 A$=" ====================":GOSUB126
120 OPEN1,8,15:OPEN2,8,2,"0:/HANGHIGH,S,R":INPUT#1,EN:IFEN=62THENGOSUB51:GOTO125
121 FORK=1TO9:INPUT#2,P$:INPUT#2,S:S$=RIGHT$(" "+MID$(STR$(S),2),3)
122 IFLEN(P$)<30THENP$=P$+" ":GOTO122
123 A$=""+STR$(K)+" "+P$+" "+S$+"%":GOSUB7
124 NEXTK:A$="":GOSUB7
125 GOSUB51:GOTO57
126 A$="## [208]LAYER [206]AME [208]CT.":GOSUB7
127 A$="---------------------------------------":GOSUB7:RETURN
128 A$="[215]ELCOME TO...":GOSUB7
129 A$="** [200][160][193][160][206][160][199][160][205][160][193][160][206] **":GOSUB7
130 A$="[212]HE OBJECT: TO GUESS THE WORD BEFORE":GOSUB7
131 A$="YOU LOSE BODY PARTS AND ARE [200][193][206][199][197][196]!!":GOSUB7
132 A$="[207]NCE YOU THINK YOU KNOW THE WORD IN":GOSUB7
133 A$="QUESTION, TYPE '1' AND ENTER THE":GOSUB7
134 A$="ENTIRE WORD, NOT JUST THE MISSING":GOSUB7
135 A$="LETTERS.":GOSUB7
136 A$="[200]AVE [198]UN!!":GOSUB7
137 REM
138 RETURN
139 A$="[200]ANGMAN [200]ELP":GOSUB7
140 A$="============":GOSUB7
143 A$="[199] - [204]OGOFF [194][194][211]":GOSUB7
144 A$="[194][194][211] - [210]ETURN TO MAIN [194][194][211]":GOSUB7
145 A$="[208][204][193][217] - [194]EGIN [208]LAYING [200]ANGMAN":GOSUB7
146 A$="[200][201][199][200] - [196]ISPLAY [212]HE [200]IGH-[211]CORES":GOSUB7
147 RETURN